<template>
<div>
   <el-dialog title="添加下游政策" :visible.sync="isshow" width="550px" :close-on-click-modal='false'>
      <div class="content">
        <el-form :model="json" :rules="rules" ref="json" label-width="150px">
          <el-form-item label="添加对象类型:" :label-width="formLabelWidth">

            部门
          </el-form-item>
          <el-form-item label="添加对象" :label-width="formLabelWidth" prop="targetId">
            <el-select no-data-text="无部门可选" class="inputs" multiple v-model="json.targetId" size="mini" placeholder="请选择对象">
              <el-option v-for="item in organization" :label="item.organizationName" :value="item.organizationId" :key="item.organizationId"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="交强险设置:" :label-width="formLabelWidth">
            <div class="numcontent" :class="indexs==1?'actives':''">
              <span>
                佣金
                <el-input class="numinp" :class="{'mmerror': adjiaoqiang}" v-model="json.lowerBrokerageTraffic" @change="adjiaoqiang1($event,'lowerBrokerageTraffic')" size="mini"></el-input>
                <span> {{json.brokerageBusinessType | isPercentage}}</span>
              </span>

              <span>
                奖励
                <el-input class="numinp" :class="{'mmerror': adjiaoqiang}" v-model="json.lowerRewardTraffic" @change="adjiaoqiang2($event,'lowerRewardTraffic')" size="mini"></el-input>
                <span> {{json.brokerageBusinessType | isPercentage}}</span>
              </span>

            </div>
          </el-form-item>

          <el-form-item label="商业险设置:" :label-width="formLabelWidth">
            <div class="numcontent" :class="indexs_tow==2?'actives_tuo':''">
              <span>
                佣金
                <el-input class="numinp" :class="{'mmerror': adshangye}" v-model="json.lowerBrokerageBusiness" @change="adshangye1($event,'lowerBrokerageBusiness')" size="mini"></el-input>
                <span> {{json.brokerageBusinessType | isPercentage}}</span>
              </span>

              <span>
                奖励
                <el-input class="numinp" :class="{'mmerror': adshangye}" v-model="json.lowerRewardBusiness" @change="adshangye2($event,'lowerRewardBusiness')" size="mini"></el-input>
                <span> {{json.brokerageBusinessType | isPercentage}}</span>
              </span>

            </div>
          </el-form-item>
          <el-form-item class="btns">

            <el-button size="small" type="primary" @click="submits('json')">确 定</el-button>
          </el-form-item>

        </el-form>
      </div>
    </el-dialog>


</div>
</template>

<script>
export default {
  name: 'svg-icon',
  props: {
    datas: {
      type: Object
    },
    save: {
      type: Function
    }
  },
  computed: {
    iconName() {
      return `#icon-${this.iconClass}`
    },
    svgClass() {
      if (this.className) {
        return 'svg-icon ' + this.className
      } else {
        return 'svg-icon'
      }
    }
  },
  mounted() {
      console.log(this.datas)
  },
  methods:{
      loadOption(){
          let params = {
        id: policyItemId
      };
      this.post(params, "services/app/policy/ChildOrganizations").then(res => {
        console.log(res);
        if (res.success) {
          this.organization = res.result;
        } else {
          this.$notify.error({
            title: "错误",
            message: res.error.message
          });
        }
      });
      }
  },
}
</script>

<style scoped>

</style>
